using System;
using System.Collections.Generic;
using System.Text;
using AandEDLL.DataAccess;
using AandEDLL.ItemSearchAPI;

namespace AandEDLL
{
    public class ItemSearch
    {
        public static List<Item> searchForItems(String itemName)
        {
            List<Item> searchResults = new List<Item>();

            if (itemName == "")
                throw new Exception("Item Name cannot be blank");

            YahooServiceFactory yahooServiceFactory = new YahooServiceFactory();
            searchResults.AddRange(yahooServiceFactory.performSearch(itemName));

            EbayServiceFactory ebayServiceFactory = new EbayServiceFactory();
            searchResults.AddRange(ebayServiceFactory.performSearch(itemName));

            return searchResults;
        }
        
    }
}
